#138 - only call defer f.Close() when needed