updated controller to test database