Thank You Gents for your help. I will test the new code tomorrow morning
Another question regarding jog panel. Is it possible to make panel positioned from bottom of the screen, not from top (current jog panel dimensions are 300x400) ?
p.s. I finally got working jog panel buttons. It is bit different from Homing buttons for eg as they maintain the current state (not only when pressed)