Expand the directory before checking