cleanup then checout