Move multiline check to earlier stage