Fixed switch statement issue