changes to config.php
added missing try catch blocks
added db script