Added validation for purchase quantity