Added a toggle state to the refresh button and fixed a few issues with refresh