Fixed the InvalidLoop.