Debugging refresh loop