Fixing object deletition bug