revert to using readline() rather than read()