fix continuous repainting