fixing redirect output