change key mismatch into assertion error