fix last tab removing bug