fixed issues #5 #6 #10 #11