fix tab closing