fix #36 and fix #38