fixed crash caused by inconsistent cell count