adds working multithreading (one thread per connection)