add useAgent support