fixed 'getPurchases' bug