fix two-step look ahead bug