Error because of keyIndex = -1 removed