finish the status machine and message dispatch system