I have a two buttons that execute the same lua function detailed below, one of them is located on the master template overlay, the other is on the device template overlay.

local page = tostring(NetRemote.GetVariable('NR.PanelName'))
if page ~= "VolumeControl" then
If I am on a page that uses the master template an press this button it works perfectly. If I navigate to a page that uses the device template, the first time I press the button it works it navigates to the 'VolumeControl' page (which happens to use the master template) if I hit the 'back' button (the only way to navigate away from this page) then press this button again NetRemote Crashes every time. can anyone help me understand whats going on here?