better error handling on saving binary kernels