using file instead of tempfile now