added head_dir configuration option