Fixed bug caused by adding the same object to different containers