Adds function to automatically set correct tab-mode