Yanked main from ConnectionDialog