debug the refresh loop