added error checking for kernel launch