Converted tick IIFE to a promise based timeout cycle to alleviate blocking