fixed toolbar state change bug