reimplemented i/o in purchasesfragment - alex