Fixing paint bug when drawing