Adding my fix for falling back to last visited tab