better prevention of errors when no prior workflow state
small fixes to JS scope, s/live/on