Added checks for item quantity