added try catch fallback for additional race condition issues on closed socket