corrected use for unset and looping over dir contents