fixed the tab switch closes all tabs-bug (issue #190)

See issue #190