fixed when_each