Change of box shape

GROMACS version: 2020.1
GROMACS modification: No
I prepared a system taking toluene as a solvent and cubic box with a box size of 1.0. till the NVT step box was cubic but after NPT step box shape changes from cubic to rectangular. both NPT and NVT was run for 5ns. I am attaching the image of the box. How can I fix it?

Use isotropic pressure coupling instead of anisotropic/semisotropic.

As you’ve found out anisotropic and even semisotropic pressure coupling can get into a situation where the box will deform into a long rectangular box and will eventually crash due to the shorter dimensions being shorter than the cut-off distances. And this can even happen with just solvent boxes.

Thank you for the advice its working