Forgot to close a file in extract function...