fix global detect
Merge pull request #2 from christineRR/master

fix global detect