fixed createOrUpdate relationship, with tests