Added multiple database support