minor fix that updates global variables