fix an exception when changing tabs
Merge pull request #3454 from devoncarew/devoncarew_fix_ex

fix an exception when changing tabs