Fix scoping for update in generated controllers