changed from key to nid