adding Aarons changes to index and database.php