fixing hang and infinite break signal break loop