rewrote flow in task dispatcher to be more synchrounous