Added typecasting of tasks