update state after toggling