more db fixes