ensure qty value is valid