fix error when closing all tabs