Datepicker bug fix