improve error message when unable to connect