Check if dir exists before trying to read it