hack to get toDataURL working