refactor on event

remove else statement