works also after selecting a tab