fix some of the date logic