fix toDataURL not found issue