now the timeout between tasks are done using window.settimeout