Datepicker bug fixing