partly fixed/implemented state-restore mechanism