writing changes to wallet