Also, I think this should be done inside of `getProgressBarState()`, so it returns the proper value.