fix closing tab