Use setInterval instead of setTimeout in advance()