Moved sharedSecret, agreement vars to class level. Moved records to main thread level.