fixed singletons bug