fix history saving and viewing