break loop when canceled