before toggle