fixes to new db routines