Added read check to files and directories before trying to traverse them