remove strangely duplicated newlines