Added support for resuming from last position