Added conditional switching button capability.