renamed nextEntityId() to nextId()