fix empty dbname bug