Have a look here for something similar. I’m not saying its a solution, but a nudge in the right direction maybe.