Added kernel error handling