Last tab logic