fix #7, fix #5