now correct timing. Fixed updateGap.