removeEvent function works