fix enter/leave events to use different internal var
Merge pull request #136 from Animatron/pegov/inout-fix

fix enter/leave events to use different internal var