credentials setting code line changes to SWITCH statement