added multiple directory support