corrected db initialization sequence