eoferror catch used to end session.