raise within the when blocks