resolve base_dir