added protection to kernel loader