created db
fixed db reference