the improved version now works better and does not fail on subsequent clicks anymore like it used to.