more db select fixes