corrected switch/case with exception