fix #47 and fix #48