Fixing switch statement