fix bug in perlin noise