Try using cleanUI() to close tabs instead of tab.close() a=me