handle multiple onentry and onexit
Merge pull request #18 from maxf/master

handle multiple onentry/onexit