changed entire app to using a Smarty templating engine, please use a Smarty engine to simulate. Also created more validation checks in newtab page