multiple database supported

probably some bugs