Fix issue of datepicker not working