Improved condition for emitting on.success