pulled out button actions and gave them separate function in the p2pconnectionmanager