bug in readpixel fixed