wrapped the request function