Added support for user provided db