Fix checkpoing bug