remove empty line if not necessary