error in creating tar file with tempfile