for loop updates and id to userid