make it read file directly from path rather than creating temp file