added working directory cleanup and creation