this version works correctly by customly remembering tab id.