add checks for missing keys