repainting bugs fixed