fixed small bug.
fixed dead lock bug.
Merge pull request #10 from cuixin/master

fixed bugs.