added addEntity and changed addOrUpdate to updateEntity