Fixed bug of purchase.state not reverting to 1