Ensure the exec operation runs properly when STDERR is generated

Ensure the exec operation runs properly when STDERR is generated