fix multithread bugs.
fix some messages.