finished fixing most bugs in newtab.php