Add better tab handling