date error handling