Fixed bug with datepicker