Finish the logic of multi-task and make some fix.