: add support for the tab switching
I use strange code here to avoid conflicts between refreshing scheme and internal logic