add instance method updateAll for updating function.