error messages working for past dates