added tab close listener