fix bug when closing tab opens empty view