Updated toggle functionality