small modification on switch case