Safe loop