Fixing an issue with dates validation