add extern to global vars
Merge pull request #1 from ai81/master

add extern to global vars