some performance fix. it works, but have no idea why. checkpoint