add correct_date function