Updated processAddresses with new error handling