Added -r flag to read so that filenames with \ will be read correctly