fix #16 and fix #17