fixed crashing when closing last tab in tab bar