Corrected checkEnvironmentCellState()