fixed bug in exception