datepicker is not working correctly