oops bug (loop boundary)