terminate inner iteration based on llh