kernel function bug updated