Fix datepicker bug