better error handling in np_kernelsum