Added ability to resume from a certain id.