updated code to deal with a quirk in the overlapping trigger issue