New event to check if tab can be closed