fixed find_days_before