Fixes issues when changing the state of the bar.