fix the output not defined bug