fix #142 and fix #143