Ensured a task is marked as completed and discarded