fixes tab handler to not mess up history