fixed problem with not setting parent key if id or name is not yet set