Fix save_state() method