passing correct variable to link_dir