fix setting id for inserted entity