Fixed bug related to redirect the out

Signed-off-by: Herbert <herberthb12@gmail.com>