fix invalid case exception