changed file reading mode from 'r' to 'rU'