Fixed bug where datepicker won't disappear