fix canvas painting