added onenter and on leave functions
updated the documentation
Merge branch 'release/0.5.1' into develop