remove check for emptiness in insertNewline