Updated logger to Singleton pattern; fixed memory leak