Fixed sample code
Allow access to trigger and states in the action
Allow reentrant triggers