fixed db initialization