fix exception handling bug
fixes