Added missing call to set function context