get database linked correctly