change global var to class var