bug fix
gracefull
use wg to block quit