fix #216 and fix #213