Improved code for getting recipient address
Update test code