improve form validation and fix datepicker