added multiple db support