fixed update canvas bug