change update_all to looping through results

So that SQL errors are not raised (errors were introduced by #391)