Ensure when writing the list of keys, we have the most upto date list