fix loop case