Ugh I went for a dumb solution but now it works