fix error using datepicker