This version checks for number of tabs
This version checks for number of tabs