support multiple `refs` in same view

Fixes an issue with using multiple `ref` in one template.