change setTimeout to setInterval