Fix tab closing