fixed error with canvas context