Section 21. Sections eighteen, nineteen and twenty shall apply to actions against persons founded upon the defective condition of their premises, or of adjoining ways, when caused by or consisting in part of snow or ice resulting from rain or snow and weather conditions; provided, that any such notice may be given by posting it in a conspicuous place on said premises and by leaving it with any person occupying the whole or any part of said premises, if there be such a person, and no such notice shall be invalid by reason of any inaccuracy or misstatement in respect to the owner's name if it appears that such error was made in good faith and did not prevent or unreasonably delay the owner from receiving actual notice of the injury and of the contention that it occurred from the defective condition of his premises or of a way adjoining the same. Failure to give such notice shall not be a defense under this section unless the defendant proves that he was prejudiced thereby.