fix the gap length check

haha, whoops!