change to shutdown and use daemon threads for NIO