exit from for when selected event is found