fix hanging issue