Fix the hanging issue