only delete lastCommit at the very end