fix bug in exception