Fixed repainting not always triggering