revise parsePurchasedItems function