fix #8
fix #9
fix #4
fix #7
fix #3