fixing hanging issue