fix sloppy bug, and implement correct icon visualization on tab swtich back and forth