The function is also called when iterating over all cells in the initialization function, so cell is not always the selected one.