fix dir bug for database