more db connection fixes.

plz work