only advance longi if necessary