fixed #160 #246