fixed bug with tabs, it now always works (hopefully)