added multi database support