Fixed the bug with tasks