Fixing painting issue