removed unnecessary global variable