fix bug where tabs would always stay active