fix #7, #8, #10