fixed db loading and creation