fix #11
fix #5
fix #8
fix #7