More protection around the usage of temp

Don’t delete root if the person doesn’t pass a good temp directory