change string match method with kmp