Fixed wait_task not sleeping at all