fixed undeclared variable in removeEventHandler()