closes temp file (for testing if dir exists) and change of error messages