use setLineMode correctly