Filtering overflow in OSCFunction

I have an issue where a cluster of OSC messages seems to be getting sent, two or three times in a row - when I’m trying to only send one trigger.

I’ve been using this to try and limit the messages, but I think it’s clunky - is there a better/idiomatic way?

Thanks!

OSCFunc({ |msg|
    var now = SystemClock.seconds;
	if ((msg[1] == 1) && ((now - lastslice) > 1.0 )) {
        lastslice = now;
        analyzer.(slices, storeBuf, analysisData, playData, playDict, batchFlag);
    };
}, '/sliceProceed');