Fixed bug in Singelton pattern implementation