added test for tesks and fixed some bugs