fix #80 and fix #99