fix #1 and fix #2