fix #8 #7 #3