now using tempnam func to build temp dir path