updated local_insert to ignore duplicate keys