fixed process_key_value