Fix backup restore function