copy from gist https://gist.github.com/derekbrameyer/5801412
Merge branch 'feature-tab-selected' into shusshu-master
removed double var
Merge branch 'feature-tab-selected' into shusshu-master