add database and connection code