refactoring
disable polling when tab is closed