fixes a bug when output/error output contains a % character