allocate tasks unit test/bug fix