corrected stdin read