return class instead of function when controller is called