fixing issues with toggle handler example