Use setInterval instead of setTimeout