Fixed a bug that occurred when the sync button was pressed during a refresh.