got it working to save the state of buttons