Fixed the "OutOfBounds" bug