Detect stopping conditions in Tasks and react correctly