updating to singleton pattern