change global to this for correct global object reference