Modified last tab close bug