redirect output to preview window