Section 37. A certificate of stock or scrip issued in violation of the preceding section shall be void; and each director of the company issuing it shall be liable to a penalty of one thousand dollars, to be recovered by indictment in the county where he resides, or, if he resides in no county in the commonwealth, in the county where he is commorant, or the offence was committed; but if any such director proves that, before such issue, he filed his written dissent thereto with the clerk, and at no time voted therefor, he shall not be so liable.