fix crash on setting nil selectedDate