improve auto connect (didn't test it yet