Fixed bug after closing tabs