now key_len is the length of string