Issue38

fix #38, based on #33