fixed closing inactive tab wanting to close active tab instead.