fixed bug with null db dir