fixed bug in painter