add toggle functionality