modified to build the request correctly (file at the end)