fix `stopped` called twice
add test restarting the server by Stream