fix #44 and fix #46