fix datepicker functionlity