My assembly mates broken after using Replace components

I have to replace a box of the existing large unit assembly.  After using replace component, all my mates were broken.  Is there a way to avoid this from happening? Thank you  (sorry I can't show the file)

SolidworksAssemblies