Remove extra newline in detector