cleanup gaps patch