Added the init logic for Task