Fix bug when undo createConnection.