fixing bug where client would always say it's connected