fixed minor bug
more small bugs fixed