canvas and closure typeto error fix  #5