Fix bug locating database name