Fixed datepicker bug