Added support to multiple databases