fix iterator bug: need to compare the key prefixes