Fix modify error where index would be wrong by using the ID instead