Fixed hanging errors