Modifying the index error
Add the default statement in switch