adding in directory logic