fix repain bug