fixed bug in checkpoint handling