Added restore logic