runAsync function attached to window object