added support for connecting to server