moved priv_dir function into rt