fix dumb bug in exception handling