Checking connected before doing stuff