Fixed referenced before assigned

'value' was referenced before assignment in lookup_kwargs_with_identifiers