Thank you very much.
yield() at the beginning of the task function solves this issue.