Fixed minor issue with singleton code