added finish events and ability to change state inside an action