fixed validation of date problem