always return new id and put new id logic in a function