fixing kmp