Merge pull request #30 from arthurblake/master

cleaned up some bad var scope issues - and fixed undefined body problem, while still logging the event