bug fix for thread-safe and socket errors