fix bug that purchasefragment cannot save state