fixed a bug, variable not properly shared across code files
see; http://stackoverflow.com/questions/14475703/inexplicable-change-in-variable-value/