Added a FunctionController.Dispose method