checking for valid end dates