Fix the way query for oldest Task is run