create and clean temp directory