popen3 is not an alternative to capture3 as it does not return status. Find another way