Closing file after reading content