fixed issues #1 #9 # 11