fix memory overflow caused by multiline support