tried to use Singleton decorator, but doesn't work with multiple threads