saves tabs state on selection