coll doesnt work the same in m4l as it does in max

Im trying to find a devices previous id, if it is copied within a live set. I am doing this by using a coll object to store "0" for previous id and "1" for new id. This code works in max perfectly if I connect a counter up to the same code. I have pasted both versions beneath.

Here is the m4l version: Try to copy the patch, and click the next/prev buttons – it only saves the last ID, and the first ID

– Pasted Max Patch, click to expand. –

Copy all of the following text. Then, in Max, select New From Clipboard.

Would be grateful if anyone can take a look, to see if theres something obvious Ive missed. Its strange, because the code works in max, but not m4l. Is it something to do with loadbang not loading properly?

I dont get it. loadbang is supposed to give 1 bang each time the device is copied, but the bang doesnt seem to occur in my patch, or it occurs twice overwriting the previous value. would be grateful for some guidance on this because its got me stumped – does loadbang load twice?

The point is that [live.path this_device] already sends the id without receiving a bang (if the device is loaded into the live set). So loadbang should be omitted here to avoid that the id is sent twice.