Temp fix for #82

Temporary fix for #82. IMO, it is better to remove the global variable