switching over to task queue instead of continuous thread