Not sure whether there exist other solutions, but what you suggest here is more or less the same as the solution provided by @Mason in this older thread:
Not sure whether there exist other solutions, but what you suggest here is more or less the same as the solution provided by @Mason in this older thread: