add error check for no dates