fix drawpixel function