moved update from attribute to scope