many small bug fixed