Make singleton thread safe