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