fix bug when checking out -> delete -> checkout again