Fix $params in request() function