fixed desctruction of singletons