fixing canvas Errror