fix get-state and put-state