fix exception in bad-case