connect and disconnect buttons call method in main