move multidb selection to middleware