Fix stackoverflow in tab navigation