Fix on Switch Statement

Switch Modification brought null exception error. Now fixed.