Fix infinite loop on reload