fix(config): correctly initialize dir before save