fix rows = 0 pattern