fix handeling of kernel