Hotkey command works well but doesn't work rarely.

My goal is making a hotkey that adjust the volume by XButton1 & Wheelup/down. This code below Most works well but sometimes doesn't. What I want is disabling browser_back function of XButton1 only when I execute volume adjustment hotkey and enabling this function when I don't execute this hotkey

    Hotkey XButton1, Off    ;Auto-execute section

    ~XButton1 & Wheelup::
        Hotkey XButton1, On ;When hotkey triggered, disable original function
                                ;of XButton1 : browser_back         
        SoundSet +2
        SoundBeep
    return
    ~XButton1 & Wheeldown::
        Hotkey XButton1, On
        SoundSet -2
        SoundBeep
    return
    XButton1:: 
        Hotkey XButton1, Off    ;Re-activate browser_back function return
    return

If I take following steps, it returns original browser_back function of XButton1 even after the hotkey is executed.

=> Open Youtube.com => Click any video => Holding XButton1, scroll wheel up and down subsequently and quickly so that there is as little delay as possible between page load, wheel up and down.

Actually first two steps can be replaced by any two website that I tried. This adjustment hotkey should be triggerd right after the page load.

Then even I heard SoundBeep, which meaning hotkey is executed so browser_back fucntion shouldn't executed, my browser goes to previous page. If I give some delay between them or for any situation not above, browser_back function doesn't executed after the hotkey. It's very weird because in most cases it works perfect. Does anyone know why this happens?