check if global exists before returning it