added base_dir option
cleanup