Template to retrieve last alexa

hello,
I am a TTS fan and I am using Alexa for nearly all my automations.

I have managed to ask Alexa about the status of my house sensors and Alexa gets back to me with the right answer after it queries sensor values from HA. It’s pretty amazing!

To achieve that, I have create a template that gives me which Alexa was used last ( as I have 3 alexa’s and I always want to know which is the alexa am talking too, because I want to “play” the answer to the same alexa am talking to)

It works great! Here is the template I am using to achieve that. I am sure that it has been discussed many times.

  - platform: template
    sensors:
      last_alexa:
        value_template: >
            {{ expand(states.group.echos) | selectattr('attributes.last_called','eq',True) | map(attribute='entity_id') | first }}

My only problem which I want your help, is that it gives me an error when I restart HA.
Is it a way I can prevent this error?

Please excuse my bad English.

Logger: homeassistant.helpers.template
Source: helpers/template.py:1706
First occurred: 23:25:48 (2 occurrences)
Last logged: 23:25:48

Template variable warning: No first item, sequence was empty. when rendering '{{ expand(states.group.echos) | selectattr('attributes.last_called','eq',True) | map(attribute='entity_id') | first }}'