fixes makeRequest() function