loops should stop when asked