fix bug that closing the newly opened tab doesn't allow you to connect again until you click twice