fixed validation of dates if they are null