added toggle functionality