implemented validation on the doToItem input and list