use setInterval instead of setTimeout

cleaner than having periodic_check calling itself in a loop via
setTimeout