HL7Spy v24 Beta Released

Setting New Standards in HL7 Data Analysis

We’re excited to unveil HL7Spy v24, pushing the boundaries of HL7 data analysis and transformation even further. The innovations we’re introducing are shaped by our users’ feedback and our daily use of the product here at Inner Harbour Software. Here’s what’s new:

  • Modernized User Experience:
    • Sleek Interface: Transition smoothly from previous versions of HL7Spy with our revamped UI, including a user-centric Dark Mode.
    • Crisper Visuals: High-Resolution monitor support guarantees precision in every detail for an unparalleled visual experience.
    • Enhanced Clarity: Enjoy improved visibility with support for high-resolution fonts and the flexibility to adjust font sizes dynamically
  • Advanced Statistics Tools:
    • Enhanced Statistics: Effortlessly navigate values with additional details like message type and Message Date/Time.

    • Field Insights: The new Field Statistics UI lets you delve deeper into values for comprehensive analysis, coupled with a Multi-Path statistics tool for aggregated field insights.
    • Message Analysis: The all-new Message Statistics feature offers insights into hourly message volumes, sizes, and types, streamlining your data analysis processes.
    • Segment and Standards: With added conformance length in the Segment Editor and support for HL7 v2.2 through v2.9, stay ahead in your HL7 standard needs.
  • Connectivity & Integration:
    • HL7 ACK Navigation: HL7 ACKs are now displayed in the HL7 Send tool. ACKs are automatically linked to the originating message.
    • Secure Transfers: The HL7 MLLP Receiver now comes with robust TLS 1.3 support, ensuring secure data transactions.
    • Cloud & Storage Integration: Elevate your navigation experience with the File Browser’s revamped UI. Seamlessly fetch files not only from AWS and Azure but also effortlessly access data via SFTP, FTPS, and Network Storage. With extensive support for authentication methods including Username/Password, Access Key, and SSO, managing your HL7 data across diverse platforms has never been this efficient.

  • Tools & Utilities:
    • Search & Segment: Multi-Value Search Tool optimizes your message searches, while the Message Split Tool provides granularity by splitting messages based on HL7 Paths.
    • Folder Watcher: Monitor in real-time with the Watch Folder Tool, auto-loading files into HL7Spy and benefiting from its filtering capabilities.
    • Quick Access: The Application Search Tool ensures you find the tools you need in an instant.
    • Stay Updated: Never miss an update or a security notice with our in-product notification system.
  • Improved Functionality & Performance: Your favorite tools have been polished, with several improvements and performance enhancements, making your HL7 data management journey smoother and faster.

Upgrade Offers:

  • Enterprise users, your upgrade to HL7Spy v24 is complimentary.
  • If you’ve purchased HL7Spy v20 in the recent 3 months, you’re eligible for a free upgrade.
  • Special promotion: HL7Spy v20 users can leap to v24 for just $299.00 for a limited period.

Our commitment remains steadfast: Delivering powerful tools inspired by your feedback and our hands-on experience with the product. Experience the future of HL7 data inspection and transformation with HL7Spy v24!


HL7Spy v2020.5.51 Released

  • Improvement – All – Updated all product libraries to their latest versions for improved functionality and potential security vulnerabilities
  • Improvement – Field Statistics – Copy and paste directly into into Excel with formatting- requested by J.R. contexture.org
  • Improvement – HL7 Sql/Sql Loader – Copy and paste directly into into Excel with formatting
  • Bug Fix – Segment Editor – Fix Up/Down buttons not working
  • Bug Fix – Open Folder – Always sort files in HL7Spy by CreatedDateTime
  • Bug Fix – HL7 Editor – Fix InvalidArgumentException
  • Bug Fix – Advisories – Better user notification of product updates and security vulnerabilities
  • Bug Fix – HL7Send – Fix item selection in the HL7 Target Selection Control

HL7Spy v2020.5.36 Released

  • Improvement – Better application level MessageBox and logging
  • Improvement – All – Updated all product dependencies to their latest versions
  • Improvement – HL7 Receiver – Do not enable checkCertificateRevocation when using SSL/TLS
  • Bug Fix – Segment Editor – Fix Up/Down buttons not working
  • Bug Fix – Licensing – Fix issue with v3 Enterprise licenses not working
  • Bug Fix – Fix issue where files downloaded from Epic are not being properly separated – Report by Chris E from cshs.org
  • Bug Fix – All Grid Controls – Fix application hang when copying data from any grid. Seems to only happen on Windows 11
  • Bug Fix – Licensing – Fix registering via the command line not always successful. Report by Jon S. at RadPartners

HL7Spy v2020.5.11 Released

  • Improvement – Settings – Store user specific settings in the User’s Documents\HL7Spy directory to help solve permissions in some locked-down environments and to prevent users on the same machine from conflicting with each other.
  • Improvement – Change behavior of grids in the application to not move to the next row when hitting the arrow key at the end of a row
  • Improvement – All – Updated all product dependencies to their latest versions
  • Bug Fix – Advisory Window – Fix index out of range exception due to json deserialization
  • Bug Fix – Settings – Fix issue where Settings are not saved when the application shuts down
  • Bug Fix – Message Editor – Fix issue where Highlight Fields doesn’t highlight all messages
  • Bug Fix – HL7Send – Fix sizing of HL7 Target Settings
  • Bug Fix – HL7Send – Don’t show Machine certificates unless running as an admin user because they cannot be used
  • Bug Fix – Cloverleaf smatdb – Fix issue with smatdbs and caching of incorrect passwords

HL7Spy v2020.4.660 Released

  • Improvement – Add support for automatically checking for new version of HL7Spy
  • Improvement – Allow downloading and installing new versions of HL7Spy from within the application
  • Security – Notify users of any known Security Vulnerabilities within HL7Spy. There are no known Security Vulnerabilities in HL7Spy but if any are found they will be automatically displayed when HL7Spy starts
  • Security – All – Updated all product dependencies to their latest versions
  • Bug Fix – HL7 Sender – Fix Destinations will not display due to a Null Reference Exception introduced with new Devexpress libraries
  • Bug Fix – HL7 Editor – Fix OutOfRangeException when decorating an HL7 message
  • Bug Fix – Cloverleaf smatdb – Fix issue where a smatdb file will not open after attempting to open with an incorrect password

HL7Spy v20.4.600 Released

  • Improvement – Minor Security Vulnerability – Use BouncyCastle directly instead of from MySql.Data to get latest nuget
  • Improvement – Security – Scan all dependencies for known Vulnerabilities
  • Improvement – Sql Loader – Updated Intersystem’s Ensemble template queries. Provided by Jeff D.
  • Improvement – All – Updated all product dependencies to their latest versions
  • Improvement – HL7 Receiver – Allow certificates from Windows StoreLocation.LocalMachine
  • Bug Fix – HL7 Editor – Fix obscure value out of range exception
  • Bug Fix – Hex Editor – Fix “Cancel” button does not stop Find Next
  • Bug Fix – HL7 To XML- Fix Value out of range exception
  • Bug Fix – Field Stats – Unexpected error in CalculateFieldStats. Query=MSH[1]-9.1.1. [Exception] ‘ ‘ Invalid Field Encoding Character|
  • Bug Fix – HL7Parser – Unexpected error: [IndexOutOfRangeException] Index was outside the bounds of the array.
  • Bug Fix – HL7 Transform – Error in Connexion v15: Function ‘coalesce’ not found
  • Bug Fix – HL7 Sender – Message that are separated with \r\n include the \n in the message and are subsequently sent by the HL7 Sender. Reported by Jeff D.
  • Bug Fix – Custom Code – Unexpected exception in CompileInternal: [TargetInvocationException] Exception has been thrown by the target of an invocation.[ArgumentException] An item with the same key has already been added.
  • Bug Fix – HL7 Editor – Fix selection offset issue when the segments end with \r\n
  • Bug Fix – File Explorer – Cannot view the hex contents of a file that was downloaded using the FTP/FTPS/SFTP

HL7Spy v20.4.541 Released

  • Improvement – HL7 Transform – HL7 Transform Device – Add function to move a segment within a message
  • Improvement – HL7 Send – Better Retry and detection of broken connections
  • Improvement – HL7 Send – Add option to Close Connection after sending each message – Requested by Robert S @uk.ibm.com
  • Improvement – HL7 Send – Improve sizing of HL7 Send tool so that it takes up less space
  • Improvement – HL7 Editor – Add DragDrop support from Editor to Compare tool
  • Improvement – HL7 Editor – Add support for inserting a Base64 file into a message – Requested by Robert S @uk.ibm.com
  • Bug Fix – HL7 Send – Fix NRE when there is no HL7 Target selected

HL7Spy v20.4.512 Released

  • Improvement – HL7 Send – Allow sort by Hostname in the target selector dialog – request by David H. from hcahealthcare.com
  • Improvement – HL7 Send – Add timestamps to HL7Send events shown in UI
  • Improvement – HL7 Send – Improve Logging of HL7 protocol events
  • Improvement – Speed startup time by initializing Sqlite in background thread
  • Improvement – HL7 Transform – Add InsertSegmentBefore, InsertSegmentAfter, ToUpper, ToLower, RegexReplace functions to HL7Transform
  • Bug Fix – HL7 Send – Fix issue where HL7 connection is closed between each message is sent using the “Single” button
  • Bug Fix – HL7 Core – Better handling of escape sequences in HL7 messages
  • Bug Fix – Custom Code – Fix issue where the Plugin folder now includes name and version of HL7Spy where it did not in the past – reported by Richard F. from healthcatalyst.com
  • Bug Fix – Custom Code – Fix issue where newly added, or removed assembly references are not properly handled by the intellisense editor
  • Bug Fix – HL7 Transform – RemoveSegment function not working – reported by Jeff D. from hicgrp.com
  • Bug Fix – [InvalidOperationException] Invoke or BeginInvoke cannot be called on a control until the window handle has been created.
  • Bug Fix – Unexpected exception in setting error indicators (129,{Line=-1,Character=-1}). System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.

How do I set the second identifier in the PID-3 field?

I need to set a 2nd field of a repeated field. For example, how do I set the second identifier for a patient in the PID-3 field? 

There are many ways to handle values in a repeated field. The following sets of code all set the 2 patient identifier to “12345^^^ALT”.

    // set using named fields
    CX cx = pid.PatientIdentifierList_03[2];
    cx.IDNumber_01.Value = "12345";
    cx.AssigningAuthority_04.NamespaceID_01.Value = "ALT";
    // set using the segment
    pid[3,2,1] = "12345";
    pid[3,2,4] = "ALT";
    // set using the message and a fully qualified Path
    message["PID-3[2].1"] = "12345";
    message["PID-3[2].4"] = "ALT";
    // set using the message with explicit SEG, FIELD, REPEAT, COMPONENT, SUBCOMPONENT
    message["PID", 1, 3, 2, 1] = "12345";
    message["PID", 1, 3, 2, 4] = "ALT";

HL7Spy v20.4.466 Released

  • Improvement – Better support for high res monitors – request by Alexander F. from xsolis.com
  • Improvement – Bulk Compare – Add feature to flag hl7 messages with differing segment orders – request by Jeff D. from hicgrp.com
  • Improvement – Custom Code – Better support for assembly references which have binding redirects
  • Improvement – Update all 3rd Party libraries to incorporate bug fixes and performance improvements made by our partners
  • Bug Fix – HL7 Standard – Fix exception thrown when setting the SplitterDistance to an invalid value
  • Bug Fix – Custom Code – Fix issue where the wrong CustomCode function is selected when a search is performed
  • Bug Fix – Ftp Explorer sometimes becomes unresponsive
  • Bug Fix – Ftp Browser – Fix tab stops in Password Dialog – requested by jeff.drumm@hicgrp.com
  • Bug Fix – Application Settings – Fix issue introduced in v20.4.450 where settings do not get stored correctly
  • Bug Fix – HL7 SQL/Sql Loader – Fix databinding error resulting in ResultsToNewTab not being stored correctly
  • Bug Fix – Cloverleaf Reader – Fix Sqlite password form size in designer
  • Bug Fix – Cloverleaf Reader – Ftp Explorer – Fix [AggregateException] A Task’s exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.
  • Bug Fix – HL7 Editor – Fix NRE in MessageCollection.Dispose

HL7Spy 20.4.413 Released

  • Improvement – Update UI libraries to include new capabilities to Grid and Tree controls
  • Improvement – Update Rebex libraries for improved FTP/FTPS support
  • Improvement – Custom Code – Add function to replace illegal characters in an HL7 message
  • Bug Fix – Application – Fix: [ArgumentException] Form showDialog tried to set an ineligible form as its owner. Forms cannot own themselves or their owners. when closing the SplashScreen
  • Bug Fix – Fix [ArgumentException] Invalid HL7Path ‘[1]-0’ in BuildReportTask
  • Bug Fix – HL7 Send – Fix NRE when there are no destinations selected and the “Connect” button is clicked
  • Bug Fix – HL7 Editor – fix NRE in HL7Editor.SetDocument
  • Bug Fix – HL7 Editor – fix [ArgumentOutOfRangeException] Specified argument was out of the range of valid values.

HL7Spy v20.3.565 Released

  • Improvement – Segment – Add commonly used operations, such as Field Statistics, when you right-click on node within the segment editor – request by Paul @diridium.com
  • Improvement – Ftp Explorer – Automatically check for new messages when double-click the file, if it is already opened
  • Improvement – Better Layout of all windows and dialogs with scaling set to 300% – requested by Ben @zotecpartners.com
  • Bug Fix – Application – Saving/Restoring current Application Window Layout not working properly in some cases
  • Bug Fix – Application – [InvalidOperationException] Cross-thread operation not valid: Control ‘ShellView’ accessed from a thread other than the thread it was created on.
  • Bug Fix – HL7 Editor – Cntrl-V does not paste into the Find window when it is active and has focus – reported by Jeff D. @hicgrp.com
  • Bug Fix – HL7 Editor – Messages starting with MSH|^~\| rather than MSH|^~\&| do not get loaded properly in HL7Spy without changing the message framing
  • Bug Fix – Field Statistics – If there is an invalid value in a DTM, INT, or DOUBLE type, the sorting stops working
  • Bug Fix – Error initializing SettingsManagerBase. [UnauthorizedAccessException] Access to the registry key ‘HKEY_LOCAL_MACHINE\SOFTWARE\Inner Harbour\SqlLoader’ is denied
  • Bug Fix – FTP Explorer – Tail is not working – Reported By Alfred @musc.edu
  • Big Fix – FTP Explorer – Issue where opening a single compressed file in FTP Explorer does not correctly open – Reported by Alfred @musc.edu
  • Bug Fix – Error in BulkCompareView.RunInternal. [InvalidOperationException] Collection was modified; enumeration operation may not execute.
  • Bug Fix – Statistics View – [NullReferenceException] Object reference not set to an instance of an object.
  • Bug Fix – Custom Code View – Mouse selection issue in the Custom Code Editor with collapsed regions
  • Bug Fix – Custom Code View – Issue where Custom Code tool was not being restored to its saved state

How can I debug Custom Code in Visual Studio?

I would like to debug the code that I have written in HL7Spy. How do I do this?

If you have Visual Studio installed, you can add Break(); to the OnStart() method of your custom code to trigger the Visual Studio debugger to launch when you push the “Run” button in the user interface.

  public override void OnStart()

Once you are in Visual Studio you can set break-points, watch variables, etc.

How do I remove the OBR segments that do not contain any corresponding OBX records?

Question: How do I remove the OBR segments that do not contain any corresponding OBX records

To do this you can loop through the OrderGroups in the message and remove all OBRs except the first one.

  public override void Run()
    // Get an HL7 Message in parsed format
    HL7Message message = GetParsedMessage();
    foreach(OrderGroup order in message.GetOrderGroups())
       int end = order.OBXs.Count == 0 ? order.OBRs.Count : order.OBRs.Count -1;
       for(int i = 0; i < end; ++i)
          OBR obr = order.OBRs[i];

    SaveMessage(message, "Modified");

How do I find all ADTs where the discharge date (PV1-45) and message date (MSH-7) differ by 30 days?

Question: How do I find all ADT messages in a tab where the date/time of the message and the discharge date of the patient is 30 days or more?

To do this you need to need to parse the PV1-45 field into an HL7DateTime and compare it to the MSH-7 date time. There is a shortcut to the MSH-7 field on the message object called MessageDateTime which can be used instead of parsing the MSH-7 field.

 public override void Run()
    // Get an HL7 Message in parsed format
    HL7Message message = GetParsedMessage();

    // if the message is not an ADT, or doesn't have a PV1 segment, skip it
    if(message.MessageCode != "ADT" || message.PV1 == null)
    if(message.MessageDateTime == null)
      return; // if we don't have a message date/time
    HL7DateTime dt;
    // try to parse the HL7 DTM
    if(!HL7DateTime.TryParse(message.PV1.DischargeDateTime_45.Value, out dt))
      return; // if we can't parse it successfully, skip it

    TimeSpan delta = dt.DateTimeOffset - message.MessageDateTime.Value;
    if(delta.TotalDays >= 30)
      SaveMessage(message, "old adt"); // save the message if it is older than our OldestDate

HL7Spy v20.3.494 Released

  • Improvement – Updates/Improvements to Core UI Libraries
  • Improvement – Custom Code – Updates/Improvements to .NET C# language libraries and editor
  • Improvement – Add the DynamicClass Identifier to the output window when compiling so that the user knows how to retrieve a backup from the backup folder
  • Improvement – Better handling of invalid characters in HL7 Message
  • Improvement – Better handling of Parser Errors/Warnings in HL7Editor
  • Improvement – Set UseLargeBuffers to true in Rebex Ftp and Sftp for better performance
  • Improvement – Speed up loading of messages
  • Improvement – BulkCompare – Speed up showing of Master/Detail results
  • Improvement – Remove even row appearance in BulkCompare tool because it looks too cluttered
  • Improvement – Sql Loader – Add option to enable/disable Even Row Appearance
  • Improvement – Statistics View – Change row and selection highlighting
  • Improvement – Custom Code – Add method HL7Segment.GetOrCreate to get or create HL7Subcomponents
  • Improvement – Custom Code – Do not create empty repeats/components/subcomponents when setting string.Empty
  • Improvement – Improve implementation of IsNull, Coalesce, == null, etc
  • Improvement – Custom Coe – Add BaseSegment.IsFieldNullOrEmpty
  • Improvement – Everywhere – Take advantage of new Devexpress search in grid column feature
  • Improvement – Bulk Compare – Highlight rows in the summary that have messages with errors
  • Improvement – Ftp Explorer – Update Rebex Libraries to take advantage of new features
  • Improvement – Everywhere – Update Devexpress Libraries to take advantage of new features
  • Bug Fix – HL7 SQL – Closing any tab always cancels the existing query
  • Bug Fix – Fix [ArgumentException] This causes two bindings in the collection to bind to the same property.
  • Bug Fix – Fix Unexpected exception in HighlightActiveField. [IndexOutOfRangeException] Index was outside the bounds of the array.
  • Bug Fix – Custom Code – Fix [NullReferenceException] Object reference not set to an instance of an object.
  • Bug Fix – Fix NRE when Custom Code Tool is hidden at startup then activated
  • Bug Fix – Fix NRE in HL7Spy.Views.MessageCollectionView.MessageEditorView.ShowMessagePropertiesView()>
  • Big Fix – Fix resizing of the FTP/SFTP Server Tree
  • Bug Fix – Fix up ToolStripSpringTextBox just for use in FileBrowser
  • Bug Fix – Fix issue where “Open Message in external editor” attempts to open the file with an empty editor path
  • Bug Fix – Fix NRE in SqlLoader DbConnection form
  • Bug Fix – Export – Fix Export of long file named message collections
  • Bug Fix – Custom Code – Fix issue with Connexion.Core appending new segments to HL7 Message
  • Bug Fix – Fix File in user exception when the Settings backup happens at start-up
  • Bug Fix – Fix ZSH-1 issue where Field is not being encoded properly into a Component
  • Bug Fix – Fix issue with detecting HL7Paths in an HL7Expression
  • Bug Fix – HL7 Message detection fixes – reported by Len F. from health.qld.gov.au
  • Bug Fix – Fix [XmlException] The ‘ ‘ character, hexadecimal value 0x20, cannot be included in a name.
  • Bug Fix – Fix unhandled exception when searching using the Multi-Value search tool
  • Bug Fix – Custom Code – Fix DateTimeOffset is not defaulting to the local DateTimeOffset when parsing HL7DateTime
  • Bug Fix – Fix issue where MSH-3, MSH-4, MSH-5 are not set correctly in the FHS and BHS segments – reported C.H @ tanaq.com
  • Bug Fix – Fix issue where message frame characters are set in each message within a batch. According the standard these should not be set. reported by C.H @ tanaq.com
  • Bug Fix – Fix threading issue with StringBuilder in HL7QueryView: [ArgumentOutOfRangeException] Index was out of range. Must be non-negative and less than the size of the collection.
  • Bug Fix – Fix HexEitorView.Selection [NullReferenceException] Object reference not set to an instance of an object.
  • Bug Fix – Fix: SplitCollectionView – [ParserException] Multiple MSHs found in message buffer at offset 1025
  • Bug Fix – Fix issue where opening files from the Ftp Explorer loads 0 messages when the configure type is a LocalFileSystem – Reported by A. Islam from health.qld.gov.au
  • Bug Fix – Message Editor – Selecting right-click option “Save Unescaped Field to File” does nothing
  • Bug Fix – Bulk Compare – Fix [NullReferenceException] Object reference not set to an instance of an object. in BulkCompare when message has errors in it
  • Bug Fix – Fix [NullReferenceException] Object reference not set to an instance of an object.
    at Be.Windows.Forms.HexEditorControl.Selection(Int64 offset, Int32 size)

HL7Spy v20.2.296 Released

  • Improvement – Bulk Difference Tool – Add support for Ignoring Extra Fields – Requested by Randall C. from vumc.org
  • Improvement – Add option to change the message framing in the Split Messages Tool – Requested by Mike T. from amwell.com
  • Improvement – Diff Tool – Update DiffView when settings change in BulkCompareView’s ignore fields
  • Improvement – Statistics – Add AverageSize to Message Statistics
  • Improvement – Remember message framing last used in SaveAs – Requested by Jeff D. from hicgrp.com
  • Improvement – HL7 Editor – Add support for changing the size that triggers field collapsing – Requested by Ruslan A. from rochesterregional.org
  • Improvement – HL7 Send – Add Clone functionality to clone an existing HL7 Target configuration – Requested by Jeff D. from hicgrp.com
  • Improvement – Diff Tool – Reduce flashing when comparing 2 messages
  • Improvement – Custom Code – Write out the custom code uid to the output window when compiling so a user can identify the correct backup file if an older version of the code needs to be restored
  • Bug Fix – Custom Code – Fix issue where when adding an assembly reference the code is blanked out – Reported by Charla from nehii.org
  • Bug Fix – HL7 Receive – Update the file name when the port changes – reported by Nick J. from Conevity
  • Bug Fix – Fix issue with formatting of DateTimes and exporting to Excel
  • Bug Fix – OBX-5 CWE not returning correct value for obx.ObservationValue_05.First.CWE_01.Text_02 – reported by Paul M. from BCCancer
  • Bug Fix – Diff Tool Fix jittering in synchronized scrolling
  • Bug Fix – Bulk Compare – Message Counts, File Path, and First Message Date time missing from dropdown
  • Bug Fix – HL7Send – Fix weird positioning of configuration window
  • Bug Fix – HL7Send – Fix up flickering when opening HL7 Send settings popup dialog
  • Bug Fix – HL7 Send – Clear the last error on each Send()
  • Bug Fix – HL7 Send – Fix issue where “Repeat” does not decrement to 0. Reported by Nick J. from Conevity
  • Bug Fix – HL7 Send – Fix issue where TargetSettings not being properly upgraded from v2.x – Reported by Matthew B. from corhio.org
  • Bug Fix – Custom Code Tool – Clone button does not work
  • Bug Fix – Hex Editor – Fix offset/size not shown in Hex Editor
  • Bug Fix – Fix sizing of count column in SqlLoader and HL7Query tool
  • Bug Fix – HL7Parser – Fix [IndexOutOfRangeException] Index was outside the bounds of the array.
  • Bug Fix – HL7Parser – Fix: [ArgumentOutOfRangeException] Index and length must refer to a location within the string.
  • Bug Fix – Ftp Explorer – Fix InvalidOperationException “Cannot send command to the server because the response for previous one was not received.” is sometimes thrown by FTP library
  • Bug Fix – Ftp Explorer – Fix issue were MessageFraming cannot be changed when files retrieved using the FTP Explorer – Reported by Brian G. from utmb.edu
  • Bug Fix – HL7 SQL – Execute Button is not restored if the tab being queried is closed