save state fixed