remove reference of a directory