handle updating the id if there already is an id