better Test-xConnection function