fixed tabmanager logic. Mainly working