setInterval is replaced with setTimeout