fixed issues with hostname and port.