Update function() to this.function() in provider