fix #29,#27,#18,#8