fixed, some bug, may cause dead lock.