Added task validation