db now opens on first use for better startup and overall performance