moved database connection to config