use object variable in place of global

Regards