Magnetic machine torch holder

The only question about the mag mounting. What do you do when it pops off while lit? Maybe wire a micro switch in series with the trigger wire?