adds handler for toggle compoment