fix #22 and fix #20