added check for rec_dir