add support for checkpoint/resume