added default error in switch