fix error handling wget