Fix a serious bug and add date unselected event.