fix #10 fix #4 fix #1