error handling for missing key