Restore sequence number from stored entries

- still a full scan
- will be optimized later