handling date exceptions