added EOF cases to error messages in thread handlers