I’m on mobile so I can’t really debug your code but I have a post about something similar that might work for you