adding button toggling behavior