rebuilt toggle handler