Fix newline bug and add clear button