adding connect and disconnect template for buttons