fix index.getKey for memory implementation