fixed #5 #7 #8 #9