[[ Bug 13644 ]] wait loop not being broken