fix non-quiting problem