implement emit-value