fixed a small bug with restore