managing and saving checkbox state