prevent closing wrong tab