checking before saving dates