added validation to tasks