Update example in README
Add before hook to state handlers