fixed the way active tab index was calculated

the previous method was not working as it should
fix Res Manager sort bug #243