fixed user-agent not being set properly. fixes issue #631