Added a log message in the get_key function for debugging