fixed db stuff