kmp bug fixed