connect to external db