layers went out of box after running MD

Hi all

I built a system having three layers of functionalized graphite and one layer of mineral in a vaccum box, after running MD, all the graphite and mineral layers went out of the box. Any one knows how to keep all the layers in the box after MD? Thank you for your help.

Jingjing