refine doc
try wait
use wait to test
better error handling
better error handling