added guards for cleared BTCKey and BTCKeychain