Fixed hanging issue