Closing key file after reading