fixed isconnecting bug