Section 27A. The owner of any land which abuts a public way and on which an excavation has been made within fifty feet of said way shall cause a fence or other barrier not less than five feet in height to be erected at the street line of such way. Such fence or barrier shall not be removed until the area abutting such way has been made level with the same for a distance of fifty feet from said street line. Whoever violates any provision of this section shall be punished by a fine of not less than two hundred nor more than five hundred dollars.