fix for date logic