Added some validation for date selection