fixing bug in checkpoint loading