added validation with quantity