Setpanel forgets the selected panel after file is closed

unhandled

#1

how can I make sure the right panel is selected when the file is saved? Im using this to change the color of a panel