move if dirty checkout outside try/catch