close file after searching