proper handling of dates