fixed wrong event handler