change palette mode to menu and fix state persistence