add threading, add server