adding memory checkpoint support