check if dir is object