fixed #38 and fixed #39