fixed mistake in Factory::removeObject