fix for gap check