remove sockopt and update download file to better handle failure