wiring up the database