fix restore script properly