removed global variable use