added support to prevent data lose when opening new sequence, closign window
etc...