bug fix in stencil_kernel