Changed to support new pattern for querying multiple databses