Fix selecting wrong (next) tab after refresh