Fix a bug on resuming
Improve resume process