cleanup on tab close