Bugfix of date validation