more database interaction tweaks