Fix error event in flow script