fixing threads and epoll