fixed adding too many insert lines