bugfix (socket not thread-safe)