cleanup working directory on any error, closes #6