syncronized hash tables and error handling on connection getting closed