fix #20, #21, #19