make sure state is saved whenever key map changes
make sure state is saved whenever key map changes