Added error check to date to see if date is valid