fixed many issues #29 #26 #19 #3