Solving bug in canvas.