improve datesSet event handler