improve work dir recording