Fixed query in deadline_failed task