fixed small bug.
fixed dead lock bug.