Hack to refresh state on tab switch.