     printf("Done transfering outputs[test_batch].out -> d_out \n");
     d_output.out = d_out;
     
-    cudaError_t err = cudaGetLastError();
+    err = cudaGetLastError();
     if (err != cudaSuccess)
         printf("Error <<< launch >>>: %s\n", cudaGetErrorString(err));
     

    cudaMalloc((void **) &(d_olens), sizeof(long));
    printf("Done allocating d_olens \n");
    
    cudaError_t err = cudaGetLastError();
    if (err != cudaSuccess)
        printf("Error <<< launch >>>: %s\n", cudaGetErrorString(err));
    

    cudaMemcpy(outputs[test_batch].out, d_out, sizeof(float)*kerns.num*outputs[test_batch].lens[batch_size-1], cudaMemcpyDeviceToHost);
    printf("Done transfering d_out -> outputs[test_batch].out \n");
    
    err = cudaGetLastError();
    if (err != cudaSuccess)
        printf("Error <<< launch >>>: %s\n", cudaGetErrorString(err));
    
