Need help! How to connect only button on last state of variant component to next frame?

Hello, I need help with Figma.
I’m working on a prototype for an application, specifically the login process with all the states. I have created all the states using components and linked them within the component. On the second page, I created a frame and inserted these prototyped components. I would like to know how I can make the button on the last step of the component prototype lead to the next frame. The problem is that when I connect it to the next frame, it leads to that frame with every click, but I want it to only lead to the last state of the component.

Hey Sandra, thank you for reaching out! Are you able to share a copy of your file?