update to solve error on canvas rendering