fixed #21 #20 #17