fix handshake error handling in RemoteManager and MainController