fix deadlock bug
add timeout read