singleton class memory leak fixed