fix bugs in handling multiline string