fix checkpointing