fix work with chain gaps