fixed checkpoint bug