fixed a bug in fill cells