changed setTimeout to setInterval