Added test function to the controller