fix bug with dead cells