setInterval replaced with setTimeout