add log & fix some small bug