moved trigger tabenabled to the end of the function and changing activepane before the trigger