Made Singleton thread-safe.