fixed bug with KeyValueStore insert()