Assignment inside the when blocks as well