bug fix

code clean
wait_for_data