modified the main.php and setup database