Fixed bug in not connected check.