set UserAgent
improve error message