fix painter end