updated global to be a singleton