moved export button instantiation to fix bug where button disappear after switch tab