fixing bug if job runs over multiple days