Updated active tab code