changes on doRequest function