Fix the overpurchase bug