added validation when processing cart items