fixed bug in exceptions