save state works, load state is buggy