Add global $cfg to avoid php notice
Merge pull request #3 from mattsches/master

Add global $cfg to avoid php notice