fixing checking the format of date values