added support for multiple tabs