fixed bug where page still opens in new tab