bug fix for output that contains holes