changed kernel selection logic