[HttpKernel] made code more reliable