added newtab.php and changes to the error checkng of Tables