Add checkpointing