diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc
index 6987680..9c9c339 100644
--- a/gtk2_ardour/midi_time_axis.cc
+++ b/gtk2_ardour/midi_time_axis.cc
@@ -340,8 +340,9 @@ MidiTimeAxisView::set_route (boost::shared_ptr<Route> rt)
 		_midi_controls_box.pack_start (_midnam_custom_device_mode_selector, false, false, 2);
 	} 
 
+	const string midnum_custom_device_mode = gui_property(X_("midnam-custom-device-mode"));
 	model_changed(gui_property(X_("midnam-model-name")));
-	custom_device_mode_changed(gui_property(X_("midnam-custom-device-mode")));
+	custom_device_mode_changed(midnum_custom_device_mode);
 
 	controls_vbox.pack_start(_midi_controls_box, false, false);
 
