fix assignment of waited_for
avoid deadlock at waitTask()