sendCommand' :: Command -> Process -> ProcessM ()
sendCommand' c p = do
    c' <- case c of
            ConnectTo _ pid cid mt -> 
               getProc pid >>= \pd -> return$ ConnectTo (uri pd) pid cid mt
            _ -> return c
    lift$ hPrint (h_in p) c'
    lift$ hFlush (h_in p)
sendCommand' :: Command -> Process -> ProcessM ()
sendCommand' c p = do
    c' <- case c of
            ConnectTo _ pid cid mt -> 
               getProc pid >>= \pd -> return$ ConnectTo (uri pd) pid cid mt
            _ -> return c
    lift$ hPrint (h_in p) c'
    lift$ hFlush (h_in p)
sendCommand' c p = do
    c' <- case c of
            ConnectTo _ pid cid mt -> 
               getProc pid >>= \pd -> return$ ConnectTo (uri pd) pid cid mt
            _ -> return c
    lift$ hPrint (h_in p) c'
    lift$ hFlush (h_in p)