started adding database code, but will only run if the database is configured